﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace K.EnterpriseLibary.Cache
{
    public static class Cookies
    {
        public static void SetCookie(double cookieExpires,params object[] cookieParams)
        {
            for (int i = 0; i < cookieParams.Length; i++)
            {
                System.Web.HttpCookie cookie = new System.Web.HttpCookie(cookieParams[i].ToString(),cookieParams[i+1].ToString());
                cookie.Expires.AddDays(cookieExpires);
                System.Web.HttpContext.Current.Response.Cookies.Add(cookie);
                System.Web.HttpContext.Current.Response.SetCookie(cookie);
            }
        }
    }
}
